/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.makrobioklub.action.web;

import cz.makrobioklub.action.controll.ActionFacadeLocal;
import cz.makrobioklub.action.entity.Action;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author xljan
 */
@ManagedBean
@SessionScoped
public class ActionList {
    @EJB
    private ActionFacadeLocal actionFacade;
    
    private Action selectedAction;

    public Action getSelectedAction() {
        return selectedAction;
    }

    public void setSelectedAction(Action selectedAction) {
        this.selectedAction = selectedAction;
    }
    
    /** Creates a new instance of ActionList */
    public ActionList() {
    }
    
    public void remove(){
        actionFacade.remove(selectedAction);
    }
    
    public List<Action> getAllAction(){
        return actionFacade.findAll();
    }
    
}
